package main.com.hu.spring5;

public class Password {

    private String password1;
    //使用set方法实现依赖注入
    public void setPassword1(String password1) {
        this.password1 = password1;
    }
    private String password2;
    //使用有参构造注入
    public Password(String password2) {
        this.password2 = password2;
    }

    public void out() {
        System.out.println("有参构造注入的属性："+password2);
        System.out.println("无参构造注入的属性："+password1);
    }

}
